#include "settings.h"


Settings::Settings() :
    set("Z.Vova", "MyDesktopServer")
{
    log.lock_add = set.value("log_lock_add").toBool();
    log.max_log_size = set.value("max_log_size").toInt();
    window_close.type = set.value("window_close_action").toInt();
    exit_on_connected.type = set.value("exit_on_connected_state").toInt();


    if(set.value("max_log_size").isNull())
    {
        log.max_log_size = 400;
        window_close.type = 2;
    }
}


Settings::~Settings()
{
    set.setValue("log_lock_add", log.lock_add);
    set.setValue("max_log_size", log.max_log_size);
    set.setValue("window_close_action", window_close.type);
    set.setValue("exit_on_connected_state", exit_on_connected.type);
}

